package com.gumball.testdrive;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import com.gumball.context.GumballMonitor;
import com.gumball.server.GumballMachineRemote;

public class GumballMonitorTestDrive {
	public static void main(String[] args) {
		String location = "rmi://127.0.0.1/gumballmachine";
		
		try {
			GumballMachineRemote gumballMachineRemote = (GumballMachineRemote)Naming.lookup(location);
			GumballMonitor gumballMonitor = new GumballMonitor(gumballMachineRemote);
			gumballMonitor.report();
		} catch (MalformedURLException | RemoteException | NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
